import { createRouter, createWebHistory } from "vue-router";
import LoginView from "../views/LoginView";
const routes = [
  {
    path: "/",
    name: "login",
    component: LoginView,
  },
  {
    path: "/home",
    name: "home",
    component: () => import("../views/HomeView.vue"),
    redirect: "/home/workbench",
    children: [
      {
        path: "workbench",
        component: () => import("../components/WorkBenchView.vue"),
      },
      {
        path: "resetpwd",
        component: () => import("../components/ResetPwd.vue"),
      },
      {
        path: "setdata",
        component: () => import("../components/SetData.vue"),
      },
      {
        path: "goodslist",
        component: () => import("../components/GoodsList.vue"),
      },
      {
        path: "create",
        component: () => import("../components/CreateGoods.vue"),
      },
    ],
  },
  // {
  //   path: '/about',
  //   name: 'about',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  // }
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
